home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 873 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: news.deltanet.com!usenet
  2. From: olivas@deltanet.com (Sergio Olivas)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Template Class Linkage?
  5. Date: Mon, 08 Jan 1996 03:53:21 GMT
  6. Organization: Delta Internet Services, Anaheim, CA
  7. Message-ID: <4cq4hs$raa@news2.deltanet.com>
  8. References: <4cmnjs$mk7@mimsy.cs.umd.edu>
  9. NNTP-Posting-Host: ana0002.deltanet.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12.  
  13. >I'm just learning templates, and I'm having problems with linkage.
  14. >When the template class member function bodies are included in the ".h" file,
  15. >everything is fine.  But when the function bodies are in a separate ".c" file,
  16. >calls to these functions from other files give an "undefined reference to
  17. >function" error from the linker.  Do template class member functions have 
  18. >to be in the ".h" file, or is this a problem with my compiler?
  19.  
  20. Yes, this is a known 'feature' of C++ -- As far as the language
  21. standard and all the compilers go. I understand an update to the C++
  22. language will include some way of including the template stuff into
  23. the .c (cpp) files, as well as provide the Standard Template library
  24. as part of the language.
  25.  
  26. later,
  27.   sergio
  28.  
  29.  
  30.